﻿using UnityEngine;
using System.Collections;

public class ObstacleManager : MonoBehaviour {

    private static ObstacleManager instance;
    public static ObstacleManager Instance()
    {
        if (instance == null)
	    {
            instance = new ObstacleManager();
	    }
        return instance;
    }



    public ArrayList obstacleList = new ArrayList();
    
    void Initialize()
    {
        GameObject [] obstacleArr = GameObject.FindGameObjectsWithTag("Obstacle");
        foreach (var item in obstacleArr)
        {
            obstacleList.Add(item);
        }
    }

    public void push(GameObject refrence)
    {
        obstacleList.Add(refrence);
    }

    public void pop(GameObject refrence)
    {
        obstacleList.Remove(refrence);
    }

    public ArrayList getObstacle()
    {
        return this.obstacleList;
    }
}
